<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<script src="//cdn.bootcss.com/jquery/1.12.4/jquery.js"></script>
<script src="//cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
456.a.com系统<br/>
你登陆的用户名：<input id="name"/><br/>
<button id="logout">退出</button>
</body>
<script>
    $(function(){
        getInfo();
       function getInfo(){
           var token = $.cookie('token');
           $.get("http://localhost:8080/info?token="+token,function(data,status){
               if (data == "") {
                   window.location.href = "http://456.a.com:8101/logina2";
               } else {
                   $("#name").val(data);
               }
           });
        };

        $("button").click(function(){
            $.removeCookie('token', {domain:'a.com'});
            getInfo();
        });
    });
</script>
</html>